package com.nifostasky.shrio.controller;

import com.nifostasky.common.utils.R;
import lombok.AllArgsConstructor;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试权限接口
 */
@RestController
@RequestMapping("/test")
@AllArgsConstructor
public class TestController {

    /**
     * 测试权限接口1
     */
    @GetMapping("/test1")
    public R test1(){
        return R.ok("测试接口1,只需登录,无需权限");
    }

    /**
     * 测试权限接口2
     */
    @GetMapping("/test2")
    @RequiresPermissions("sys:schedule:info")
    public R test2(){
        return R.ok("测试接口2,登录后还需要权限");
    }
}
